package com.zyl.pagergallerysave_java.volley;

import android.content.Context;

import com.android.volley.RequestQueue;
import com.android.volley.toolbox.Volley;

public class VolleyUtils {
    private Context context;
    private static VolleyUtils volleyUtils;
    private RequestQueue requestQueue;

    private VolleyUtils(Context context) {
        this.context = context;
    }

    public static VolleyUtils getVolleyUtils(Context context) {
        if (volleyUtils == null) {
            volleyUtils = new VolleyUtils(context);
        }
        return volleyUtils;
    }

    public RequestQueue getRequestQueue() {
        if (requestQueue == null) {
            requestQueue = Volley.newRequestQueue(context);
        }
        return requestQueue;
    }
}
